using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_AdjHeaderMap : EntityTypeConfiguration<so_AdjHeader>
    {
        public so_AdjHeaderMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Number)
                .HasMaxLength(20);

            this.Property(t => t.CostCenter)
                .HasMaxLength(50);

            this.Property(t => t.Created_By)
                .HasMaxLength(30);

            this.Property(t => t.Location)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("so_AdjHeader");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.date).HasColumnName("date");
            this.Property(t => t.TotalCost).HasColumnName("TotalCost");
            this.Property(t => t.CostCenter).HasColumnName("CostCenter");
            this.Property(t => t.Created_By).HasColumnName("Created_By");
            this.Property(t => t.Location).HasColumnName("Location");
        }
    }
}
